#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int DigitSum(int n)
{
	int a = 0;
	a = n % 10;
	if (n == 0)
		return 0;
	else
		return a + DigitSum(n / 10);
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	printf("%d", DigitSum(n));
	return 0;
}